package com.itheima.innerclass1;

public class Outer {

    public static double PI = 3.14;
    public static void go() {
        System.out.println("go()");
    }

    private String name;
    public void run() {
        System.out.println("run()");
    }

    public static class Inner {

        private int num;

        public void show() {

            System.out.println("show()");

            //静态内部类可以直接访问外部类中的静态成员
            System.out.println(PI);  //同一类中访问可以省略类名前缀
            go();

            //静态内部类不能直接访问外部类中的实例成员
            //System.out.println(name);  //报错
            //run();      //报错

        }

        public Inner() {

        }

        public Inner(int num) {
            this.num = num;
        }

        public void setNum(int num) {
            this.num = num;
        }

        public int getNum() {
            return num;
        }
    }
}
